<?php 

  /**
    *
    * FILE:          pwd.php
    * LOCATION:      /root
    * REFERENCES:    none 
    * FUNCTION:      salts password for all users      
    * DEPENDENCIES:  db_connect.php
    *
    *                
    * --NOT BEING USED FOR FUNCTIONS IN THIS DIRECTORY
    * 
    * ==============================================================================
    * 
    * @version $Id: nav.php,v 0.1 2007/09/3
    * @copyright Copyright (c) none
    * @author ChrisV
    * @license http://opensource.org/licenses/gpl-license.php GNU General 
    * Public License (GPL)
    * 
    * ==============================================================================
    * p:heartoftexas - m:lifesaver - b:centexhbc - j:consumerchoice - su:brazosstream
    * t:bearpower - st:halloffame - p:wacolights
    */


   //connect to database
   include('./../includes/db_connect.php');

   //get all user names
   $query  = "SELECT * 
			FROM user 
			WHERE user_name='Angela York'";
   //run query
   $result = mysql_query($query);
   //salt passwords for each user in database
   while($row=mysql_fetch_array($result)) {
     $user_name = $row["user_name"];
     $pass      = $row["password"];
     echo "$user_name $pass  <br />";
     $pass      = "ay7783"; 
     $salt      = substr(md5(uniqid(rand(), true)), 0, 10);
     $password  = md5($salt.md5($pass));
	
     $insert    = "UPDATE user 
                   SET salt = '".$salt."', password = '".$password."' 
                   WHERE user_name = '".$user_name."'";
     mysql_query($insert);  //
     echo "$user_name $pass  <br />";
   } 
?>